import request from '../utils/request';

// 获取某个菜谱的评论（一级评论）
export const getCommentsByRecipeId = async (recipeId) => {
  return request.get(`/comment/comments/${recipeId}`);
}

// 获取某个评论的回复(二级评论）
export const getRepliesByCommentId = async (commentId) => {
  return request.get(`/comment/comments/replies/${commentId}`);
}

// 发表评论
export const addComment = async (data) => {
  return request.post(`/comment/comments/add`,data);
}
//删除评论
export const deleteComment = async (data) => {
  return request.delete(`/comment/comments/del`,data);
}
//点赞
export const like = async (data) => {
  return request.post(`/comment/commentLike`,data);
}
//取消点赞
export const unlike = async (data) => {
  return request.delete(`/comment/commentLike`,data);
}
//获取点赞状态
export const getLikeStatus = async (data) => {
  return request.post(`/comment/commentLike/status`,data);
}
//获取点赞数量
export const getLikeCount = async (data) => {
  return request.get(`/comment/commentLike/count`,data);
}





